<?php

 
	include_once ("../configs/config.php");     //配置参数
	include_once ("../common/mysql.class.php");   //MySQL操作类
	include_once ("../common/action.class.php");   //MySQL操作类
	
	$user_id = $_COOKIE['user_id'];
	$db = new action($mydbhost, $mydbuser, $mydbpw, $mydbname, "temp_conn", $mydbcharset, $mydbtag); //实例化数据库类
	$bottle_id = $db->pickup_bottle($user_id);
	if($bottle_id < 0){
		// 没有找到瓶子id
		$return_array = array('ret'=>$bottle_id);
		print_r(json_encode($return_array)); 
	}
	else{
		$bottleinfo_list = $db->get_bottle_info($bottle_id);
		$message_list	 = $db->get_bottle_msg($bottle_id, 0, $message_num_onepage);
		
		$return_array = array('return'=>0,'bottle_info'=>$bottleinfo_list,'message_info'=>$message_list);
		print_r(json_encode($return_array)); 
	}
?>
